function ModuleUpload(doc, container, width, height, user, date, options) {
  this._doc = doc;
  this._container = container;
  this._width = width;
  this._height = height;
  this._user = user;
  this._date = date;
  this._options = options;
  
  this._createElements();
};

ModuleUpload.prototype._createElements = function() {
  this._gui = new Upload(this._doc, this._container, this._width, this._height, this._user, this._date, this._options)._gui;
  
  DOMUtils.removeChildElements(this._gui.uploaded);
  DOMUtils.removeChildElements(this._gui.uploading);
  
  var unique = (this._options && this._options.u) ? this._options.u : '';
  
  var pp = document.createElement('div');
  var ss = document.createElement('div');
  pp.id = unique + UploadUtils._defaultProgressTargetId;
  ss.id = unique + UploadUtils._defaultDivStatusId;
  this._gui.uploading.appendChild(pp);
  this._gui.status.appendChild(ss);
  
  var callbackFunc = (this._options && this._options.callbackFunc) ? this._options.callbackFunc : null;
  var popupBox = (this._options && this._options.popupBox) ? this._options.popupBox : null;
  popupBox._gui.close.onclick = function() { popupBox._close(); callbackFunc(); };
  
  this._files = [];
};

ModuleUpload.prototype._callbackFunc = function(file, result) {
  this._files[this._files.length] = result;
  
  DOMUtils.removeChildElements(this._gui.uploaded);
  if (this._views) {
    for (var i = 0, il = this._views.length; i < il; i++) {
      var tmp = this._views[i];
      tmp._close();
    }
  }
  
  this._views = [];
  var tr, td;
  tr = this._gui.uploaded.insertRow(-1);
  td = tr.insertCell(-1);
  td.align = 'left';
  td.style.verticalAlign = 'top';
  td.style.height = '75px';
  var table = this._doc.createElement('table');
  table.cellPadding = 0;
  table.cellSpacing = 0;
  table.style.width = '80px';
  table.style.height = '75px';
  td.appendChild(table);
  for (var i = 0, il = this._files.length; i < il; i++) {
    var tmp = this._files[i];
    
    var itable = this._doc.createElement('table');
    itable.cellPadding = 0;
    itable.cellSpacing = 0;
    itable.style.width = '80px';
    itable.style.height = '75px';
    
    if (table.rows.length == 0)  {
      itd = table.insertRow(-1).insertCell(-1).appendChild(itable);
    } else if (table.rows[table.rows.length - 1].cells.length < 5) {
      itd = table.rows[table.rows.length - 1].insertCell(-1).appendChild(itable);
    } else {
      itd = table.insertRow(-1).insertCell(-1).appendChild(itable);
    }
    
    itd.align = 'center';
    this._views[this._views.length] = new ModuleViewFile(this._doc, itd, null, null, this._user, this._date, { item: tmp } );
  }
};
